//
//  FMDownloadImage.h
//  WOM
//
//  Created by leeqb on 12/5/13.
//  Copyright (c) 2013 cst. All rights reserved.
//

#import <Foundation/Foundation.h>

@class FMDownloadImage;
@protocol DownloadImageDelegate <NSObject>

@optional
- (void)downloadImage:(FMDownloadImage *)loadImage downloadFinished:(UIImage *)image;

@end

@interface FMDownloadImage : NSObject<NSURLConnectionDataDelegate>
{
    NSMutableData *_imageData;
    NSURLResponse *_response;
}

@property (nonatomic, copy)  NSString *filePath;
@property (nonatomic, assign) id <DownloadImageDelegate> delegate;
@property (nonatomic, assign) NSInteger tag;
@property (nonatomic, retain) id target;

- (id)initWithTarget:(id)target;

- (void)downLoadImageWithURL:(NSString *)url imagetype:(NSString *)type; // 下载图片，缓存到本地，以url地址的md5串来命名

@end
